// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//
#pragma once

#include <cstdint>
#include <string>

namespace kmsql::pg {
    enum class PGSimplifiedTokenType : uint8_t {
        PG_SIMPLIFIED_TOKEN_IDENTIFIER,
        PG_SIMPLIFIED_TOKEN_NUMERIC_CONSTANT,
        PG_SIMPLIFIED_TOKEN_STRING_CONSTANT,
        PG_SIMPLIFIED_TOKEN_OPERATOR,
        PG_SIMPLIFIED_TOKEN_KEYWORD,
        PG_SIMPLIFIED_TOKEN_COMMENT
    };

    struct PGSimplifiedToken {
        PGSimplifiedTokenType type;
        int32_t start;
    };

    enum class PGKeywordCategory : uint8_t {
        PG_KEYWORD_UNRESERVED = 0,
        PG_KEYWORD_COL_NAME = 1,
        PG_KEYWORD_TYPE_FUNC = 2,
        PG_KEYWORD_RESERVED = 3,
        PG_KEYWORD_NONE = 4
    };


    struct PGKeyword {
        std::string text;
        PGKeywordCategory category;
    };
}
